github.com/hyperion-hyn/go-ethereum@v2.4.0+incompatible/docs/Privacy/Tessera/Configuration/Configuration Overview.md (about)

     1  # Configuration file
     2  
     3  A `.json` file including required configuration details must be provided using the `-configfile` command-line property when starting Tessera.
     4  
     5  Many configuration options can be overridden using the command-line.  See the [Using CLI to override config](../Using%20CLI%20to%20override%20config) page for more information.
     6  
     7  ## Configuration options
     8  The configuration options are explained in more detail in this section.  Configuration options that require more than a brief explanation are covered in separate pages.
     9  
    10  ### Cryptographic Keys
    11  See [Keys page](../Keys).
    12  
    13  ### Whitelist
    14  If set to true, the `peers` list will be used as the whitelisted urls for the Tessera node:
    15  ```
    16  "useWhiteList": true,
    17  ```
    18  
    19  ---
    20  
    21  ### Database
    22  Tessera's database uses JDBC to connect to an external database. Any valid JDBC URL may be specified, refer to your providers details to construct a valid JDBC URL.
    23  
    24  ```
    25  "jdbc": {
    26    "url": "[JDBC URL]",
    27    "username": "[JDBC Username]",
    28    "password": "[JDBC Password]"
    29  }
    30  ```
    31  
    32  ---
    33  
    34  ### Server
    35  > **For Tessera versions prior to 0.8:** See [Legacy Server Settings](../Legacy%20server%20settings).
    36  
    37  To allow for a greater level of control, Tessera's API has been separated into distinct groups.  Each group is only accessible over a specific server type.  Tessera can be started with different combinations of these servers depending on the functionality required.  This is defined in the configuration and determines the APIs that are available and how they are accessed.
    38   
    39  The possible server types are:
    40  
    41  - `P2P` - Tessera uses this server to communicate with other Transaction Managers (the URI for this server can be shared with other nodes to be used in their `peer` list - see below)
    42  - `Q2T` - This server is used for communications between Tessera and its corresponding Quorum node
    43  - `ENCLAVE` - If using a remote enclave, this defines the connection details for the remote enclave server (see the [Enclave docs](../../Tessera%20Services/Enclave#types-of-enclave) for more info) 
    44  - `ThirdParty` - This server is used to expose certain Transaction Manager functionality to external services such as Quorum.js
    45  - `ADMIN` - This server is used for configuration management. It is intended for use by the administrator of the Tessera node and is not recommended to be advertised publicly
    46  
    47  The servers to be started are provided as a list:
    48  ```
    49  "serverConfigs": [
    50     ...<server settings>...
    51  ]
    52  ```
    53  
    54  Each server is individually configurable and can advertise over HTTP, HTTPS or a Unix Socket.  The format of an individual server config is slightly different between Tessera v0.9 and v0.8:
    55  
    56  #### Server configuration (v0.9)
    57  HTTP:
    58  ```
    59  {
    60      "app": "<app type>",
    61      "enabled": <boolean>,
    62      "serverAddress":"http://[host]:[port]/[path]
    63      "communicationType" : <enum>, // "REST" or "GRPC"
    64  }
    65  ```
    66  HTTPS:
    67  ```
    68  {
    69      "app": "<app type>",
    70      "enabled": <boolean>,
    71      "serverAddress":"https://[host]:[port]/[path]
    72      "communicationType" : <enum>, // "REST" or "GRPC"
    73      "sslConfig": {
    74          ...<SSL settings, see below>...
    75      }
    76  }
    77  ```
    78  Unix Socket:
    79  ```
    80  {
    81      "app": "<app type>",
    82      "enabled": <boolean>,
    83      "serverAddress":"unix://[path],
    84      "communicationType" : "REST"
    85  }
    86  ```
    87  
    88  #### Server configuration (v0.8)
    89  HTTP:
    90  ```
    91  {
    92      "app": "<app type>",
    93      "enabled": <boolean>,
    94      "serverSocket":{
    95          "type": "INET",
    96          "port": <int>, //The port to advertise and bind on (if binding address not set)
    97          "hostName": <string> // The hostname to advertise and bind on (if binding address not set)
    98      },
    99      "communicationType" : <enum>, // "REST" or "GRPC"
   100      "bindingAddress": <string> //An address to bind the server to that overrides the one defined above
   101  }
   102  ```
   103  
   104  HTTPS:
   105  ```
   106  {
   107      "app": "<app type>",
   108      "enabled": <boolean>,
   109      "serverSocket":{
   110          "type": "INET",
   111          "port": <int>, //The port to advertise and bind on (if binding address not set)
   112          "hostName": <string> // The hostname to advertise and bind on (if binding address not set)
   113      },
   114      "communicationType" : <enum>, // "REST" or "GRPC"
   115      "bindingAddress": <string>, //An address to bind the server to that overrides the one defined above
   116      "sslConfig": {
   117         ...<SSL settings, see below>...
   118      }
   119  }
   120  ```
   121  
   122  Unix Socket: 
   123  ```
   124  {
   125      "app": "<app type>",  
   126      "enabled": <boolean>, 
   127      "serverSocket":{
   128          "type":"UNIX",
   129          "path": <string> //the path of the unix socket to create
   130      },
   131      "communicationType" : "UNIX_SOCKET"
   132  }
   133  ```
   134  
   135  ### TLS/SSL: server sub-config
   136  See [TLS/SSL](../TLS) page.
   137  
   138  ### CORS: server sub-config
   139  For the ThirdParty server type it may be relevant to configure CORS.
   140  ```
   141  {
   142      "app":"ThirdParty",
   143      "enabled": true,
   144      "serverAddress": "http://localhost:9081",
   145      "communicationType" : "REST",
   146      "cors" : {
   147          "allowedMethods" : ["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD"],
   148          "allowedOrigins" : ["http://localhost:63342"],
   149          "allowedHeaders" : ["content-type"],
   150          "allowCredentials" : true
   151      }
   152  },
   153  ```
   154  The configurale fields are:
   155  * `allowedMethods` - the list of allowed HTTP methods. If omitted the default list containing `"GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD"` is used.
   156  * `allowedOrigins` - the list of domains from which to accept cross origin requests (browser enforced). Each entry in the list can contain the "*" (wildcard) character which matches any sequence of characters. Ex: "*locahost" would match "http://localhost" or "https://localhost". There is no default for this field.
   157  * `allowedHeaders` - the list of allowed headers. If omitted the request `Access-Control-Request-Headers` are copied into the response as `Access-Control-Allow-Headers`.
   158  * `allowCredentials` - the value for the `Access-Control-Allow-Credentials` response header. If omitted the default `true` value would be used.  
   159  
   160  ### InfluxDB Config: server sub-config
   161  Configuration details to allow Tessera to record monitoring data to a running InfluxDB instance.
   162  ```
   163  "influxConfig": {
   164    "hostName": "[Hostname of Influx instance]",
   165    "port": "[Port of Influx instance]",
   166    "pushIntervalInSecs": "[How often to push data to InfluxDB]",
   167    "dbName": "[Name of InfluxDB]"
   168  }
   169  ```
   170  
   171  ---
   172  
   173  ### Peers
   174  A list of URLs used by Tessera to communicate with other nodes.  Peer info is shared between nodes during runtime (however, please note the section on `Peer Discovery` below).
   175  ```
   176  "peer": [
   177    {
   178      "url": "http://myhost.com:9000"
   179    },
   180    {
   181      "url": "http://myhost.com:9001"
   182    },
   183    {
   184      "url": "http://myhost.com:9002"
   185    }
   186  ]
   187  ```
   188  
   189  ### Disabling peer discovery
   190  If peer discovery is disabled, then **only** peers defined in the configuration file will be communicated with; any peers notified by other nodes will be ignored. This allows nodes to be 'locked down' if desired.
   191  ```
   192  "disablePeerDiscovery": true
   193  ```
   194  
   195  ---
   196  
   197  ### Always-send-to
   198  It is possible to configure a node that will be sent a copy of every transaction, even if it is not specified as a party to the transaction. This could be used, for example, to send a copy of every transaction to a node for audit purposes. Specify the public keys to forward transactions onto, and these will be included as if you had specified them on the `privateFor` field to start with.
   199  
   200  ```
   201  "alwaysSendTo":["<public key 1>", "<public key 2>"]
   202  ```
   203  
   204  ---
   205  
   206  ### Remote-Key-Validation
   207  Tessera provides an API `/partyinfo` on Tessera P2P server to discover all the peers in the network. In order to prevent attackers trying to inject malicious addresses against public keys, where they will try to assign the address to direct private transactions to them instead of the real owner of the key, we have added a feature to enable node level validation on the remote key that checks the remote node does in fact own the keys that were advertised. Only after the keys are validated with the remote node to ensure they own them, the keys are added to the local network info (partyinfo) store.
   208  
   209  Default configuration for this is `false` as this is BREAKABLE change to lower versions to Tessera 0.10.0. To enable this, simple set below parameter to true in the configuration:
   210  
   211  ```
   212   "features": {
   213      "enableRemoteKeyValidation": true
   214    }
   215  ```
   216  
   217  ---
   218  
   219